<template>
	<view>
		<hmReplyCard @replay="replay" :list="problems"/>
		<uni-popup ref="virt" type="bottom" background-color="#fff">
			<Virtualman @refulesh="refulesh"/>
		</uni-popup>
	</view>
</template>

<script>
	import {
		mapGetters
	} from "vuex";
    import hmReplyCard from './hm-reply-card/components/hm-reply-card/index.vue'
	import Virtualman from './Virtualman/publish.vue'
	import { getProblemList } from '@/api/order'
	import { addProblub } from '@/api/order.js'
	export default {
		computed: mapGetters(['uid']),
		components: {
			hmReplyCard,
			Virtualman
		},
		data() {
			return {
				problems: []
			};
		},
		onLoad: function(options) {
			this.getList()
		},
		methods: {
			refulesh({area, image}) {
				
				addProblub({title:'222',area:area, image: image }).then( res => {
					this.$refs.virt.close()
					this.getList()
				})
				
			},
			replay() {
				
				this.$refs.virt.open()
			},
			getList() {
				getProblemList({}).then(res => {
					this.problems = res.data
				})
			},
            
        }
	}
</script>

<style scoped lang="scss">
</style>
